class CreateEntities < ActiveRecord::Migration
  def self.up
    create_table :entities do |t|
      t.column :type,       :string,    :null => false
      t.column :name,       :string,    :null => false
      t.column :url,        :string
      t.column :email,      :string
      t.column :phone,      :string
      t.column :fax,        :string
      t.column :address,    :string
      t.column :zip,        :string
      t.column :remark,     :text
      t.column :created_at, :timestamp, :null => false
      t.column :updated_at, :timestamp, :null => false
    end
    
    add_index :entities, :name, :unique => true
  end

  def self.down
    drop_table :entities
  end
end
